/**
 * 
 */
package game;

/**
 * @author Jean-Baptiste BORIC
 *
 */
public class TileType {
	
	private int tile;
	private String type;
	private String image;
	private int defense;
	
	/**
	 * @param tile
	 * @param type
	 * @param image
	 * @param defense
	 */
	public TileType(int tile, String type, String image, int defense) {
		super();
		
		this.setTile(tile);
		this.setType(type);
		this.setImage(image);
		this.setDefense(defense);
	}

	/**
	 * @return Tile ID
	 */
	public int getTile() {
		return tile;
	}
	
	/**
	 * @param tile Tile ID
	 */
	public void setTile(int tile) {
		if(tile < 0) {
			throw new IllegalArgumentException("Tile ID below 0");
		}
		this.tile = tile;
	}
	
	/**
	 * @return Type of tile
	 */
	public String getType() {
		return type;
	}
	
	/**
	 * @param type the Type of tile
	 */
	public void setType(String type) {
		this.type = type;
	}
	
	/**
	 * @return Name of image
	 */
	public String getImage() {
		return image;
	}
	
	/**
	 * @param image name of image
	 */
	public void setImage(String image) {
		this.image = image;
	}
	
	/**
	 * @return The defense of the tile
	 */
	public int getDefense() {
		return defense;
	}
	
	/**
	 * @param defense The defense of the tile
	 */
	public void setDefense(int defense) {
		if(defense < 0 || defense > 5) {
			throw new IllegalArgumentException("Defense not between 0 and 5");
		}
		this.defense = defense;
	}

	@Override
	public String toString() {
		return tile + "\t" + type + "\t" + image + "\t" + defense;
	}
	
}
